/**
 * 步骤导航组件
 * 处理步骤间的导航逻辑
 */
import React from 'react';
import { Button, Space } from 'antd';

interface StepNavigationProps {
  currentStep: number;
  totalSteps: number;
  onNext: () => void;
  onPrev: () => void;
  onSubmit: () => void;
  onReset: () => void;
  loading: boolean;
  apiLoading: boolean;
}

const StepNavigation: React.FC<StepNavigationProps> = ({
  currentStep,
  totalSteps,
  onNext,
  onPrev,
  onSubmit,
  onReset,
  loading,
  apiLoading
}) => {
  return (
    <Space size="large" className="w-full justify-center">
      {currentStep > 0 && (
        <Button 
          onClick={onPrev} 
          size="large"
          disabled={apiLoading}
        >
          上一步
        </Button>
      )}
      
      {currentStep < totalSteps - 1 ? (
        <Button 
          type="primary" 
          onClick={onNext}
          loading={loading}
          size="large"
        >
          下一步
        </Button>
      ) : (
        <Button 
          type="primary" 
          onClick={onSubmit}
          loading={apiLoading}
          size="large"
        >
          生成项目
        </Button>
      )}
      
      <Button 
        onClick={onReset}
        disabled={apiLoading}
        size="large"
        danger
        ghost
      >
        重置表单
      </Button>
    </Space>
  );
};

export default StepNavigation;
